/********************************************************************************
do-file to replicate tables in:
	Chacon, Mario and Jeff Jensen. 2019. "Democratization, De Facto Power, and Taxation: 
	Evidence from Military Occupation during Reconstruction" World Politics 

data file needed: Dataset_1 (Main Panel) 
*/


clear all 
set more off

**Set Working Directory 
*cd "C:\****\ Replication Files (Chacon & Jensen, WP 2019)\Datasets\"

*** Table 3. Black Local Officeholders
use Dataset_1, clear 

** Controls where DORecon = d_occup_recon
global ldc lnTotPop1860 i_lnTotPop1860_DORecon ///
lnFarValRPc1860 i_lnFarValRPc1860_DORecon 

global ldc2 lnAgriGdpRPc1870 i_lnAgriGdpRPc1870_DORecon ///
lnManGdpRPc1870 i_lnManGdpRPc1870_DORecon

** c1-c3
reg d_black_taxo_6777 i_black_sh_1860_DORecon black_sh_1860 d_occup_recon st1-st16  if sample==1 & year==1870, r
outreg2 using Table3.xls,  keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast replace 

reg d_black_taxo_6777 i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc st1-st16 if sample==1 & year==1870, r
outreg2 using Table3.xls,  keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 

reg d_black_taxo_6777 i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc $ldc2 st1-st16 if sample==1 & year==1870, r
outreg2 using Table3.xls, keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 

** c4-c6 
reg d_black_exe_6777 i_black_sh_1860_DORecon black_sh_1860 d_occup_recon st1-st16 if sample==1 & year==1870, r
outreg2 using Table3.xls, keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 

reg d_black_exe_6777 i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc st1-st16 if sample==1 & year==1870, r
outreg2 using Table3.xls, keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 

reg d_black_exe_6777 i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc $ldc2 st1-st16 if sample==1 & year==1870, r
outreg2 using Table3.xls, keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 

* c7-c9
reg d_black_all_6777 i_black_sh_1860_DORecon black_sh_1860 d_occup_recon st1-st16 if sample==1 & year==1870, r
outreg2 using Table3.xls,  keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 

reg d_black_all_6777 i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc st1-st16 if sample==1 & year==1870, r
outreg2 using Table3.xls,  keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 

reg d_black_all_6777 i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc $ldc2 st1-st16 if sample==1 & year==1870, r
outreg2 using Table3.xls, keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon) dec(3) noast 


*** Table 4. Participation & Republican Support 
**Controls for turnout p1 (1860-1868/72), where DOM = d_occup_1870 

global ldc3 lnTotPop1860 i_lnTotPop1860_DOM ///
lnFarValRPc1860 i_lnFarValRPc1860_DOM 

global ldc4 lnAgriGdpRPc1870 i_lnAgriGdpRPc1870_DOM ///
lnManGdpRPc1870 i_lnManGdpRPc1870_DOM

* c1-c2 p1-delta(1860-1868/72)
reg del_turn_p1 i_black_sh_1860_DOM black_sh_1860 d_occup_1870 $ldc3 st1-st16 if sample==1 & year==1870, r
outreg2 using table5.xls, keep(i_black_sh_1860_DOM black_sh_1860 d_occup_1870) dec(3) noast replace 

reg del_turn_p1 i_black_sh_1860_DOM black_sh_1860 d_occup_1870 $ldc3 $ldc4 st1-st16 if sample==1 & year==1870, r 
outreg2 using table5.xls, keep(i_black_sh_1860_DOM black_sh_1860 d_occup_1870) dec(3) noast 

* c3-c4 p2-delta(1868/72-1880)
reg del_turn_p3 i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc st1-st16 if sample==1 & year==1880, r
outreg2 using table5.xls, keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon)  dec(3) noast 

reg del_turn_p3 i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc $ldc2 st1-st16 if sample==1 & year==1870, r
outreg2 using table5.xls, keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon)  dec(3) noast 

** c5-c6 Republican Share Gob. Elections (1868-77)  
reg rep_vs_recon i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc st1-st16 if sample==1 & year==1870, r
outreg2 using table5.xls, keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon)  dec(3) noast 

reg rep_vs_recon i_black_sh_1860_DORecon black_sh_1860 d_occup_recon $ldc $ldc2 st1-st16 if sample==1 & year==1870, r
outreg2 using table5.xls, keep(i_black_sh_1860_DORecon black_sh_1860 d_occup_recon)  dec(3) noast 

** c7-c8 Republican Delegates, 1867-68 Conventions 
**Controls for Pre-Reconstruction year 1867, where DOP = d_occup_1867 

global ldc5 lnTotPop1860 i_lnTotPop1860_DOP ///
lnFarValRPc1860 i_lnFarValRPc1860_DOP 

global ldc6 lnAgriGdpRPc1870 i_lnAgriGdpRPc1870_DOP ///
lnManGdpRPc1870 i_lnManGdpRPc1870_DOP

**Rep Convention Delegates  
reg tot_rep_del i_black_sh_1860_DOP black_sh_1860 d_occup_1867 $ldc5 st1-st16 if sample==1 & year==1870, r
outreg2 using table5.xls, keep(i_black_sh_1860_DOP black_sh_1860 d_occup_recon)  dec(3) noast 

reg tot_rep_del i_black_sh_1860_DOP black_sh_1860 d_occup_1867 $ldc5 $ldc6 st1-st16 if sample==1 & year==1870, r
outreg2 using table5.xls, keep(i_black_sh_1860_DOP black_sh_1860 d_occup_recon)  dec(3) noast 
